int diff; /* (multiplied by ten internally) */
int terr; /* (likewise) */
time_t exported;
+ char *hint; /* all these UTF8, XML entities removed, May be not HTML. */
+ char *desc_short;
+ char *desc_long;
} geocache_data ;
const char *get_cache_icon(const waypoint *waypointp);
char * xml_entitize(const char * str);
char * str_utf8_to_cp1252( const char * str );
+char * str_utf8_to_ascii( const char * str );
/*
* PalmOS records like fixed-point numbers, which should be rounded
vmem_t current_tag;
static waypoint *wpt_tmp;
+static int cache_descr_is_html;
static FILE *fd;
static FILE *ofd;
static void *mkshort_handle;
tt_cache_container,
tt_cache_difficulty,
tt_cache_terrain,
+ tt_cache_hint,
+ tt_cache_desc_short,
+ tt_cache_desc_long,
tt_cache_log_wpt,
tt_rte,
tt_rte_name,
{ tt_cache_container, 1, "/gpx/wpt/groundspeak:cache/groundspeak:container" },
{ tt_cache_difficulty, 1, "/gpx/wpt/groundspeak:cache/groundspeak:difficulty" },
{ tt_cache_terrain, 1, "/gpx/wpt/groundspeak:cache/groundspeak:terrain" },
+ { tt_cache_hint, 1, "/gpx/wpt/groundspeak:cache/groundspeak:encoded_hints" },
+ { tt_cache_desc_short, 1, "/gpx/wpt/groundspeak:cache/groundspeak:short_description" },
+ { tt_cache_desc_long, 1, "/gpx/wpt/groundspeak:cache/groundspeak:long_description" },
{ tt_cache_log_wpt, 1, "/gpx/wpt/groundspeak:cache/groundspeak:logs/groundspeak:log/groundspeak:log_wpt" },
{ tt_rte, 0, "/gpx/rte" },
}
}
+static void
+tag_cache_desc(const char ** attrv)
+{
+ const char **avp;
+
+ cache_descr_is_html = 0;
+ for (avp = &attrv[0]; *avp; avp+=2) {
+ if (strcmp(avp[0], "html") == 0) {
+ if (strcmp(avp[1], "True") == 0) {
+ cache_descr_is_html = 1;
+ }
+ }
+ }
+}
+
static void
start_something_else(const char *el, const char **attrv)
{
case tt_cache_log_wpt:
if (opt_logpoint)
tag_log_wpt(attr);
+ break;
+ case tt_cache_desc_long:
+ case tt_cache_desc_short:
+ tag_cache_desc(attr);
+ break;
}
if (passthrough) {
start_something_else(el, attr);
sscanf(cdatastrp, "%f", &x);
wpt_tmp->gc_data.diff = x * 10;
break;
+ case tt_cache_hint:
+ rtrim(cdatastrp);
+ if (cdatastrp[0]) {
+ wpt_tmp->gc_data.hint = xstrdup(cdatastrp);
+ }
+ break;
+ case tt_cache_desc_long:
+ rtrim(cdatastrp);
+ if (cdatastrp[0]) {
+ wpt_tmp->gc_data.desc_long = xstrdup(cdatastrp);
+ }
+ break;
+ case tt_cache_desc_short:
+ rtrim(cdatastrp);
+ if (cdatastrp[0]) {
+ wpt_tmp->gc_data.desc_short = xstrdup(cdatastrp);
+ }
+ break;
case tt_cache_terrain:
sscanf(cdatastrp, "%f", &x);
wpt_tmp->gc_data.terr = x * 10;